import pb2 from './proto.js'
import {routerResp} from './routerResp'

const pt = pb2.pb
export class ProtoBufDecoder {
    lookup(router: string) {
        return !!routerResp[router]
    }

    build(router: string) {
        const apiName = routerResp[router];
        if (pt[apiName]) {
            return pt[apiName];
        }
        console.error('no such router', router);
        return null;
    }
}